﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reviewer.Entities.Services;
using Reviewer.Data;
using System.Web;
using Reviewer.Entities;
using System.Web.Caching;

namespace Reviewer.Business.Services
{
    internal class NewsletterService : BaseService, INewsletterService
    {
        internal NewsletterService() : base() { }

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            GC.SuppressFinalize(this);
        }

        #region INewsletterService Members

        public bool IsSignedUp(string email)
        {
            return new NewsletterRepository().Exists(email);
        }

        public bool Signup(string email)
        {
            return new NewsletterRepository().Create(email);
        }

        public bool Unsubscribe(string email)
        {
            return new NewsletterRepository().Delete(email);
        }

        #endregion
    }
}
